package zsrt.com.menu;

import java.util.Scanner;
import zsrt.com.service.SvrExaminee;
import zsrt.com.validate.Validate;

/**
 * 考生界面
 * 
 * @author 罗智壕-13424431416
 *
 *         2017年4月20日
 */
public class UserMenu {
	public static void userMenu(Scanner scanner, MenuDesign menu) {
		SvrExaminee svr = new SvrExaminee();
		boolean over = new Validate().validateIdPasswordLogin(scanner);
		if(over){
			while (true) {
				menu.userFirstMenu();
				int number = scanner.nextInt();
				if (number == 1) {
					while (true) {
						menu.myDataMenu();
						int message = scanner.nextInt();
						if (message == 1) {
							svr.examineeFindMessage();
						} else if (message == 2) {
							svr.examineeUpdateMessage();
						} else if (message == 3) {
							break;
						} else {
							System.err.println("输入无效..请重新输入");
						}
					}
				} else if (number == 2) {
					svr.examineeTotalScore();
				} else if (number == 3) {
					svr.examineeEveryCityScholar();
				} else if (number == 4) {
					svr.examineeTotalCity();
				} else if (number == 5) {
					while (true) {
						menu.statisticsMenu();
						int count = scanner.nextInt();
						if (count == 1) {
							svr.examineeCitySort();
						} else if (count == 2) {
							svr.examineeCityOrderBy();
						} else if (count == 3) {
							break;
						} else {
							System.err.println("输入无效..请重新输入");
						}
					}
				} else if (number == 6) {
					break;
				} else {
					System.err.println("输入无效..请重新输入");
				}
			}
		} else {
			System.err.println("输入的准考号码或密码错误，请重新输入....");
		}
	}
}
